//
//  CustomNavgation.m
//  wulihan
//
//  Created by Gamefire on 16/3/28.
//  Copyright © 2016年 tang. All rights reserved.
//

#import "CustomNavgation.h"
#import "Header.h"
@interface CustomNavgation()



@end
@implementation CustomNavgation

//- (instancetype)init{
//    self =[super init];
//    if (self) {
//    }
//    return self;
//}



- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _NavView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WithView, 64)];
        [self addSubview:_NavView];
        
        
        _label = [[UILabel alloc] initWithFrame:CGRectMake(20, 25, WithView - 40, 30)];
        [_label setTextColor:uicolor(152, 152, 152)];
        [_NavView addSubview:_label];
        
        
        _searchImage = [[UIImageView alloc] initWithFrame:CGRectMake(6, 6, 17, 17)];
        [_label addSubview:_searchImage];
        
        _btn = [[UIButton alloc] init];
        [_btn setFrame:CGRectMake(0, 0, WithView, 64)];
        [_btn addTarget:self action:@selector(plushEvent) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_btn];
        
        
        [self addView];

    }
    return self;
}



- (void)addView{


    
    [self setUserInteractionEnabled:YES];
    
    [_NavView setBackgroundColor:uicolor(253, 202,47)];
    [_NavView setUserInteractionEnabled:YES];
    
    _label.layer.masksToBounds = YES;
    _label.layer.cornerRadius = 15.0;
    
    _label.text = [NSString stringWithFormat:@"        搜索您喜爱明星的相关信息"];
    _label.font = [UIFont fontWithName:@"Arial" size:13];
    
    [_label setBackgroundColor:[UIColor whiteColor]];
    [_label setUserInteractionEnabled:YES];
    

    [_searchImage setImage:[UIImage imageNamed:@"sousuo.png"]];
    [_searchImage setUserInteractionEnabled:YES];
    
    
    
}


// Button Responed to Event
- (void)plushEvent{
    if (_delegate && [_delegate respondsToSelector:@selector(touchBtn)]) {
        [_delegate touchBtn];
    }
}
@end
